package com.example.daydayup.designPatterns.study14;

/**
 * Description: 观察者<br/>
 *
 * @author: wells <br/>
 * @since 2024-04-1 19:25
 */
public class User implements Observer {

    private String name;
    private String message;

    public User(String name) {
        this.name = name;
    }

    @Override
    public void update(String message) {
        this.message = message;
        read();
    }

    public void read() {
        System.out.println(name + " 收到推送消息： " + message);
    }

}
